class NetBuffer(object):
    def __init__(self):
        self._content = []
    
    def length(self):
        return len(self._content)
    
    def append(self,data):
        self._content.append(data)
        
    def getItems(self,number=1):
        if number > 0:
            if self.length() == 0:
                return False
            elif self.length() < number:
                number = self.length
        else:
            number = self.length()
        
        data = self._content[0:number]
        del self._content[0:number]
        return data
        
    def flush(self):
        self._content = []